<?php
/*
Module: RadLib_STRING.php
Description: An Extension Library to Support string manipulation functions
*/

// Library Class Definition
class RadLibTOPFIVEREASONS {
	function tag_FIVEREASONS($node) {
		$node->stackPush();
		$node->evalNodes();
		$node->stackPop();
	}

	function tag_HEADER($node) {
		$node->assign("ListMessage", "Top Five Reasons to use RadTemplate (Component)", true);
		$node->stackPush();
		$node->evalNodes();
		$node->stackPop();
	}

	function tag_BODY($node) {
		$arrTopFive = array("Fast", "Flexible", "Extensible", "Powerful", "Free");
		$node->stackPush();
		for($i = 0; $i < count($arrTopFive); $i++) {
			$node->assign("ListIndex", $i, true);
			$node->assign("ListValue", $arrTopFive[$i], true);
			$node->evalNodes();
		}
		$node->stackPop();
	}

	function tag_FOOTER($node) {
		$node->stackPush();
		$node->evalNodes();
		$node->stackPop();
	}

	function setTagHandlers($tagLib) {
		$tagLib->setTagHandlerFunc("topfivereasons", "tag_FIVEREASONS", $this);
		$tagLib->setTagHandlerFunc("header", "tag_HEADER", $this);
		$tagLib->setTagHandlerFunc("body", "tag_BODY", $this);
		$tagLib->setTagHandlerFunc("footer", "tag_FOOTER", $this);
	}
}

// Library Tag Installation
function RadLibImport_TOPFIVEREASONS($tagLib) {
	$obj = new RadLibTOPFIVEREASONS();
	$obj->setTagHandlers($tagLib);
}
?>